#obj-m:=hello.o
#KERNELDIR:=/lib/modules/4.4.0-97-generic/build    //现在才知道学英文干什么，kerneldir
#PWD:=$(shell pwd)
#modules:                                                                                         
#	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
#modules_install:
#	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
#
#
#
#
#
#
#
#KVERS = $(shell uname -r)

#Kernel modules
#obj-m += hello.o

# Specify flags for the module compilation.
#EXTRA_CFLAGS=-g -O0

#build: kernel_modules

#kernel_modules:
#	make -C /lib/modules/$(KVERS)/build M=$(CURDIR) modules

#clean:
#	make -C /lib/modules/$(KVERS)/build M=$(CURDIR) clean
#	
#
#
#
KERN_VER = $(shell uname -r)
KERN_DIR = /lib/modules/$(KERN_VER)/build


# 开发板的linux内核的源码树目录
#KERN_DIR = /root/driver/kernel

obj-m    += kncok.o

all:
	make -C $(KERN_DIR) M=`pwd` modules

cp:
	cp *.ko /root/chensong/driver_test

.PHONY: clean    
clean:
	make -C $(KERN_DIR) M=`pwd` modules clean
